<?php
/**
 * Object represents connection to database
 *
 * @author: Dragan Milchevski
 * @date: 2012-06-23
 */
class Connection{
	private $connection;

	public function Connection(){
		$this->connection = ConnectionFactory::getConnection();
		
	}

	public function close(){
		ConnectionFactory::close($this->connection);
	}
	
	public function getConnection(){
		return $this->connection;
	}

	/**
	 * Executing sql query in the database
	 *
	 * @param sql query sql
	 * @return result from the query
	 */
	public function executeQuery($sql){
		return $this->connection->query($sql);
	}
}
?>